package subject_set.newcoder;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

/**
 * @author haomin
 * @date 2023/01/15 15:05
 **/
public class NC1 {
    public String solve (String s, String t) {
        // write code here
        int i = s.length()-1, j = t.length()-1;
        int pre = 0;
        StringBuffer sb = new StringBuffer();
        while(i >= 0 || j >= 0 || pre > 0) {
            int a = i < 0 ? 0 : s.charAt(i) - '0';
            int b = j < 0 ? 0 : t.charAt(j) - '0';
            sb.append((a + b + pre) % 10);
            pre = (a + b + pre) / 10;
            i--; j--;
        }
        return sb.reverse().toString();
    }
}